package van.planifolia.observer;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/9 19:34
 */
public class Radio1 implements Radio{
    private String name;

    public Radio1(String name) {
        this.name = name;
    }

    /**
     * 收音机的广播行为，受到广播站控制
     * @param msg 播放的消息
     */
    @Override
    public void play(String msg) {
        System.out.println(this.name+" 说："+msg);
    }

    @Override
    public String toString() {
        return "Radio1{" +
                "name='" + name + '\'' +
                '}';
    }
}
